destinator: Check result of first gbfread.
authoroliskoli <oliskoli>
Sun, 17 Aug 2008 21:29:48 +0000 (21:29 +0000)
committeroliskoli <oliskoli>
Sun, 17 Aug 2008 21:29:48 +0000 (21:29 +0000)
destinator.c

index 7ddac676c70b7dc4e337aff84561cb719161cc8f..ce88a0961f37a4eadcb04de7419141d10af9153d 100644 (file)
@@ -340,7 +340,9 @@ destinator_read(void)
        double d0, d1;
        char buff[16];
        
-       gbfread(buff, sizeof(buff), 1, fin);
+       if (! gbfread(buff, 1, sizeof(buff), fin))
+               fatal(MYNAME ": Unexpected EOF (end of file)!\n");
+
        i0 = le_read32(&buff[0]);
        i1 = le_read32(&buff[4]);